<script setup lang='ts'>
import { ref, watch } from 'vue';

 const count = ref(0)
 const name = ref("123")
 watch([count, name], (newValue, oldValue) => {
   console.log("新值" +newValue, "旧值" +oldValue)
 })
</script>
       
<template>
    <h1>Watch最简单用法</h1>
    <button @click="count--">-</button>   
    <span>{{ count  }}</span>
    <button @click="count++">+</button> 
    <input type="text" v-model="name">  
</template>
       
<style scoped>
       
</style>